import { default as request, cloud } from '@/framework/utils/request'

const getNoticeList = (params) => request({ url: `${cloud.notice}/sysMessageCenter/getNoticePage/V2`, method: 'get', params })
const getUserTree = (params) => request({ url: `${cloud.usercenter}/sysUser/getUserSelectTree/v2`, method: 'get', params })
const addNotice = (params) => request({ url: `${cloud.notice}/sysMessageCenter/sendNotice`, method: 'post', data: params })
const deleteNotice = (params) => request({ url: `${cloud.notice}/sysNotice/delete`, method: 'post', data: params })
const getNoticeDetail = (params) => request({ url: `${cloud.notice}/sysNotice/detail`, method: 'get', params })
const getDictList = (params) => request({ url: `${cloud.dqbasic}/dict/page`, method: 'get', params })
const editNotice = (params) => request({ url: `${cloud.notice}/sysNotice/edit`, method: 'post', data: params })
export {
  getNoticeList,
  getUserTree,
  addNotice,
  deleteNotice,
  getNoticeDetail,
  getDictList,
  editNotice
}
// 查询日志详情
export function noticeDetail(messageId) {
  return request({
    url: `${cloud.notice}/sysMessageCenter/detail?messageId=${messageId}`,
    method: 'get'
  })
}
